home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / polyCleanup.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.7 KB  |  149 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // $RCSfile: polyCleanup.mel $
  19. //
  20. // $Source: /vobs/aw/Maya/src/PolySlice/Commands/scripts/polyCleanup.mel $
  21. // $Locker:  $
  22. //
  23. // $Author: mmah $
  24. // $Revision: /main/3 $
  25. // $Date: 1999/12/20 15:16:37 $
  26. //
  27. // Copyright (C) 1999 Alias|Wavefront,
  28. // a division of Silicon Graphics Limited.
  29. //
  30. // The information in this file is provided for the exclusive use of the
  31. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  32. // and incorporate this code into other products for purposes authorized
  33. // by the Alias|Wavefront license agreement, without fee.
  34. //
  35. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  36. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  37. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  38. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  39. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  40. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  41. // PERFORMANCE OF THIS SOFTWARE.
  42. //
  43. //  Alias|Wavefront Script File
  44. //  MODIFY THIS AT YOUR OWN RISK
  45. //
  46. //  Creation Date: May 11, 1999
  47. //  Last Updated:  June 4, 1999
  48. //  Author:        Bernard Kwok
  49. //
  50. //  Procedure Name:
  51. //
  52. //        polyCleanup (command). 
  53. //
  54. //        Input Arguments:
  55. //            0 / 1        : Do the cleanup on all selectable meshes
  56. //            0 / 1        : Only select things that need to be cleaned up
  57. //            0 / 1        : With or without construction history
  58. //
  59. //            0 / 1         : Triangulate 4-sided faces
  60. //            0 / 1        : Triangulate > 4-sided faces    
  61. //            0 / 1        : Triangulate concave faces
  62. //            0 / 1        : Triangulate holed faces    
  63. //            0 / 1        : Triangulate non-planar faces
  64. //
  65. //            0 / 1        : Delete zero area faces
  66. //            <float>        : Face tolerance
  67. //            0 / 1        : Delete zero area edges
  68. //            <float>        : Edge tolerance
  69. //            0 / 1        : Delete faces with zero area map (uv area)
  70. //            <float>    : Map tolerance
  71. //        Returns:
  72. //            string, of items affected. Empty if no items affected.
  73. //
  74. // Example:
  75. //        // Select from all meshes, all of the criteria
  76. //        //
  77. //        polyCleanup 1 1 1  1 1 1 1 1  1 0.1 1 0.1 1 0.1;
  78. //
  79. //  Description:
  80. //
  81. //      Perform a 'cleanup' of various 'bad' polygon geometry
  82. //        attributes. This includes:
  83. //
  84. //        Deletion of:
  85. //        - zero area face 
  86. //        - zero area edges 
  87. //        - zero area mapped faces 
  88. //
  89. //        Triangulization of :
  90. //          - non-planar polygons
  91. //          - 4 to N sided polygons
  92. //          - concave polygons
  93. //          - polygons with holes.
  94. //
  95. //      Triangulization will occur first, before deletion.
  96. // 
  97. // 
  98. //////////////////////////////////////////////////////////////////////
  99.  
  100. global proc string[]
  101. polyCleanup(int $allMeshes, int $selectOnly, int $historyOn,
  102.             int $quads, int $nsided, int $concave, int $holed,
  103.             int $nonplanar, int $zeroGeom, float $zeroGeomTol,
  104.             int $zeroEdge, float $zeroEdgeTol, int $zeroMap,
  105.             float $zeroMapTol)
  106. //
  107. // Description:
  108. //        Perform a cleanup on polygonal meshes (command)
  109. // Arguments:
  110. //        allMeshes : All selectable meshes
  111. //        selectOnly : Only perform a selection
  112. //        historyOn : keep construction history
  113. //
  114. //        quads : check for quads polys
  115. //        nsided : check for n-sided polys
  116. //        nonplanar : check fo non-planar polys
  117. //        holed : check for holed polys
  118. //        concave : check for concave polys
  119. //
  120. //        zeroGeom : check for 0 area faces
  121. //        zeroGeomTol : tolerance for face areas
  122. //        zeroEdge : check for 0 length edges
  123. //        zeroEdgeTol : tolerance for edge length
  124. //        zeroMap : check for 0 uv face area 
  125. //        zeroMapTol : tolerance for uv face areas
  126. //
  127. // Returns:
  128. //        list of items cleaned up. Empty if none
  129. //
  130. {
  131.     string $args[] = {(string)
  132.         $allMeshes,
  133.         $selectOnly,
  134.         $historyOn,
  135.         $quads,
  136.         $nsided,
  137.         $concave,
  138.         $holed,
  139.         $nonplanar,
  140.         $zeroGeom,
  141.         $zeroGeomTol,
  142.         $zeroEdge,
  143.         $zeroEdgeTol,
  144.         $zeroMap,
  145.         $zeroMapTol
  146.     };
  147.     return (polyCleanupArgList ("1", $args));
  148. }
  149.